_Pragma("once");

#include <string>
#include<forward_list>
#include <vector>
#include <unistd.h>

#include "IExtendDeviceManager.h"
#include "SpiCommunicator.h"
#include "ExtendHub.h"
#include "SpiChannel.h"


class ExtendDeviceManager10 : public IExtendDeviceManager {

public:
    friend class SingletonTemplate<ExtendDeviceManager10>;
    /** Default destructor */
    ~ExtendDeviceManager10();


    void initialize();

    virtual bool initial() {
        return true;
    }

    bool doWork() override;


    bool doUpdateInformation() noexcept;


    bool updateOnlineDevice(ChannelDevices& channelDevices) override;


protected:

    ExtendDeviceManager10();

    SpiCommunicator mouterCommunicator;

    public:
    ExtendHub mextendHub;
    SpiChannel mextendHubChannel;

//    std::shared_ptr<std::thread> mrecvThread;
    char mbuffer[STRING_BUFFER_SIZE * 3];//50 STRING_BUFFER_SIZE
};


